<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * Select dialog window.
-->
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Select Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script src="common/fck_dialog_common.js" type="text/javascript">
</script>

<script type="text/javascript" src="fck_select/fck_select.js">
</script>

<script type="text/javascript">

var dialog  = window.parent ;
var oEditor = dialog.InnerDialogLoaded() ;

// Gets the document DOM
var oDOM = oEditor.FCK.EditorDocument ;

var oActiveEl = dialog.Selection.GetSelectedElement() ;

var oListText ;
var oListValue ;

window.onload = function()
{
    // First of all, translate the dialog box texts
    oEditor.FCKLanguageManager.TranslatePage(document) ;

    oListText   = document.getElementById( 'cmbText' ) ;
    oListValue  = document.getElementById( 'cmbValue' ) ;

    // Fix the lists widths. (Bug #970)
    oListText.style.width = oListText.offsetWidth ;
    oListValue.style.width = oListValue.offsetWidth ;

    if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
    {
        GetE('txtName').value       = oActiveEl.name ;
        GetE('txtSelValue').value   = oActiveEl.value ;
        GetE('txtLines').value      = GetAttribute( oActiveEl, 'size' ) ;
        GetE('chkMultiple').checked = oActiveEl.multiple ;

        // Load the actual options
        for ( var i = 0 ; i < oActiveEl.options.length ; i++ )
        {
            var sText   = HTMLDecode( oActiveEl.options[i].innerHTML ) ;
            var sValue  = oActiveEl.options[i].value ;

            AddComboOption( oListText, sText, sText ) ;
            AddComboOption( oListValue, sValue, sValue ) ;
        }
    }
    else
        oActiveEl = null ;

    dialog.SetOkButton( true ) ;
    dialog.SetAutoSize( true ) ;
    SelectField( 'txtName' ) ;
}

function Ok()
{
    oEditor.FCKUndo.SaveUndoStep() ;

    var sSize = GetE('txtLines').value ;
    if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
        sSize = '' ;

    oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'SELECT', {name: GetE('txtName').value} ) ;

    SetAttribute( oActiveEl, 'size' , sSize ) ;
    oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;

    // Remove all options.
    while ( oActiveEl.options.length > 0 )
        oActiveEl.remove(0) ;

    // Add all available options.
    for ( var i = 0 ; i < oListText.options.length ; i++ )
    {
        var sText   = oListText.options[i].value ;
        var sValue  = oListValue.options[i].value ;
        if ( sValue.length == 0 ) sValue = sText ;

        var oOption = AddComboOption( oActiveEl, sText, sValue, oDOM ) ;

        if ( sValue == GetE('txtSelValue').value )
        {
            SetAttribute( oOption, 'selected', 'selected' ) ;
            oOption.selected = true ;
        }
    }

    return true ;
}

        
</script>
</head>
<body style="overflow: hidden">
<table width="100%" height="100%">
<tr>
<td>
<table width="100%">
<tr>
<td nowrap><span fcklang="DlgSelectName">Name</span>&nbsp;</td>
<td width="100%" colspan="2"><input id="txtName" style=
"WIDTH: 100%" type="text"></td>
</tr>

<tr>
<td nowrap><span fcklang="DlgSelectValue">Value</span>&nbsp;</td>
<td width="100%" colspan="2"><input id="txtSelValue" style=
"WIDTH: 100%; BACKGROUND-COLOR: buttonface" type="text" readonly
></td>
</tr>

<tr>
<td nowrap><span fcklang="DlgSelectSize">Size</span>&nbsp;</td>
<td nowrap><input id="txtLines" type="text" size="2" value=
"">&nbsp;<span fcklang="DlgSelectLines">lines</span></td>
<td nowrap align="right"><input id="chkMultiple" type=
"checkbox"><label for="chkMultiple" fcklang=
"DlgSelectChkMulti">Allow multiple selections</label></td>
</tr>
</table>

<br>
 

<hr style="POSITION: absolute">
<span style="LEFT: 10px; POSITION: relative; TOP: -7px" class=
"BackColor">&nbsp;<span fcklang="DlgSelectOpAvail">Available
Options</span>&nbsp;</span> 

<table width="100%">
<tr>
<td width="50%"><span fcklang="DlgSelectOpText">Text</span><br>
 <input id="txtText" style="WIDTH: 100%" type="text"> </td>
<td width="50%"><span fcklang="DlgSelectOpValue">Value</span><br>
 <input id="txtValue" style="WIDTH: 100%" type="text"> </td>
<td valign="bottom"><input onclick="Add();" type="button" fcklang=
"DlgSelectBtnAdd" value="Add"></td>
<td valign="bottom"><input onclick="Modify();" type="button"
fcklang="DlgSelectBtnModify" value="Modify"></td>
</tr>

<tr>
<td rowspan="2"><select id="cmbText" style="WIDTH: 100%" onchange=
"GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
size="5"></select> </td>
<td rowspan="2"><select id="cmbValue" style="WIDTH: 100%" onchange=
"GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
size="5"></select> </td>
<td valign="top" colspan="2"></td>
</tr>

<tr>
<td valign="bottom" colspan="2"><input style="WIDTH: 100%" onclick=
"Move(-1);" type="button" fcklang="DlgSelectBtnUp" value="Up"> <br>
 <input style="WIDTH: 100%" onclick="Move(1);" type="button"
fcklang="DlgSelectBtnDown" value="Down"> </td>
</tr>

<tr>
<td valign="bottom" colspan="4"><input onclick=
"SetSelectedValue();" type="button" fcklang="DlgSelectBtnSetValue"
value="Set as selected value">&nbsp;&nbsp; <input onclick=
"Delete();" type="button" fcklang="DlgSelectBtnDelete" value=
"Delete"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

